<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <canvas id="c1" width="600" height="400">
        当前浏览器不支持canvas，请下载最新的浏览器
        <a href="https://www.google.cn/intl/zh-CN/chrome/">立即下载</a>
    </canvas>

    <script>
        /** @type {HTMLCanvasElement} **/
        var c1 = document.getElementById("c1");
        var ctx = c1.getContext("2d");
        
        ctx.beginPath();
        ctx.moveTo(240,300);
        ctx.quadraticCurveTo(150,300,150,200);
        ctx.quadraticCurveTo(150,100,300,100);
        ctx.quadraticCurveTo(500,100,500,200);
        ctx.quadraticCurveTo(500,300,300,300);
        ctx.quadraticCurveTo(300,350,200,370);
        ctx.quadraticCurveTo(250,350,240,300);
        ctx.stroke();
        ctx.closePath();
    </script>
</body>
</html>